#!/usr/bin/env python
# -*- coding:utf8 -*-
"""
Author : mafei
@Date   : 2019/12/02

"""
import os

path_of_current_file = os.path.abspath(__file__)
path_of_current_dir = os.path.split(path_of_current_file)[0]

def numCPUs():
    if not hasattr(os, "sysconf"):
        raise RuntimeError("No sysconf detected.")
    return os.sysconf("SC_NPROCESSORS_ONLN")


# common config
bind = "127.0.0.1:11111"
# user                    = 'www-data'
# group                   = 'www-data'
# debug                  = True
daemon = False  # use supervisor
# pidfile                 = "/var/run/pvs_gunicorn.pid"
logconfig               = path_of_current_dir + "/gunicorn_logging.conf"
# accesslog = "/data/log/gunicorn/gunicorn.access.log"
# errorlog = "/data/log/gunicorn/gunicorn.error.log"

# options
preload_app = False
reload = True
workers = 2
backlog = 2048
worker_class = "gevent"
limit_request_fields = 200
keepalive = 5
max_requests = 1024
timeout      = 3600